home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #46 (Jul 89) / XCMD Source / FileClose.c next >
Text File  |  1989-05-01  |  972b  |  44 lines

  1. /********************************/
  2. /* File: FileClose.c            */
  3. /*                                */
  4. /* XCMD to access the file mgr    */
  5. /* call FSClose                    */
  6. /* Paramters:                    */
  7. /* param0 = file reference from    */
  8. /* the fileopen xcmd            */
  9. /* ----------------------------    */
  10. /********************************/
  11.  
  12. #include    <MacTypes.h>
  13. #include    <OSUtil.h>
  14. #include    <MemoryMgr.h>
  15. #include    <FileMgr.h>
  16. #include    <ResourceMgr.h>
  17. #include    <pascal.h>
  18. #include    <strings.h>
  19. #include     "HyperXCmd.h"
  20. #include    "HyperUtils.h"
  21.  
  22.     
  23. pascal void main( paramPtr )
  24.     XCmdBlockPtr    paramPtr;
  25. {
  26.     short        refnum;
  27.     char        str[256];
  28.     
  29.     /* convert the refnum to a usable form */
  30.     HLock( paramPtr->params[0] );
  31.     ZeroToPas( paramPtr, *(paramPtr->params[0]), &str );
  32.     HUnlock( paramPtr->params[0] );
  33.     refnum = (short)StrToNum( paramPtr, &str );
  34.     
  35.     /* Normally we should check the result     */
  36.     /* code but it won't kill us to ignore    */
  37.     /* the reslt of a close file call        */
  38.     if ( FSClose(refnum) )
  39.         ;
  40.  
  41.     paramPtr->returnValue = 0L;
  42. }
  43.  
  44.